<?php
/**
 * comments.php
 */

if( get_option('openid_enable_commentform') ) {
	/* add_action( 'wp_head', 'myspaceid_js_setup', 9); */
	add_action( 'wp_footer', 'myspaceid_comment_profilelink', 10);
	/* add_action( 'wp_footer', 'myspaceid_comment_form', 10); */
}

function myspaceid_comment_profilelink() {
	global $wp_scripts;

	if ( !is_a($wp_scripts, 'WP_Scripts') ) {
		$wp_scripts = new WP_Scripts();
	}

	if ((is_single() || is_comments_popup()) && myspaceid_is_user_myspaceid() && $wp_scripts->query('comments')) {
		echo '<script type="text/javascript">myspaceid_add_name_style()</script>';
	}
}

function myspaceid_comment_form() {
	global $wp_scripts;

	if ( !is_a($wp_scripts, 'WP_Scripts') ) {
		$wp_scripts = new WP_Scripts();
	}

	if (!is_user_logged_in() && (is_single() || is_comments_popup()) && isset($wp_scripts) && $wp_scripts->query('comments')) {
		echo '<script type="text/javascript">add_openid_to_comment_form()</script>';
	}
}

?>